package ai.assist.common.businesss.mongo.entity;

import com.anwen.mongo.annotation.ID;
import com.anwen.mongo.annotation.collection.CollectionField;
import com.anwen.mongo.annotation.collection.CollectionName;
import com.anwen.mongo.enums.IdTypeEnum;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 系统权限
 * @TableName sys_permission
 */
@CollectionName(value ="sys_permission")
@Data
public class SysPermission implements Serializable {

    @ID(type = IdTypeEnum.OBJECT_ID)
    @CollectionField("_id")
    private String id;

    /**
     * 父级菜单权限名称
     */
    @CollectionField(value = "pid")
    private String pid;

    @CollectionField(exist = false)
    private String pidName;
    /**
     * 菜单权限名称
     */
    @CollectionField(value = "name")
    private String name;

    /**
     * path
     */
    @CollectionField(value = "path")
    private String path;

    /**
     * 组件
     */
    @CollectionField(value = "component")
    private String component;

    /**
     * 标题
     */
    @CollectionField(value = "title")
    private String title;

    /**
     * 隐藏
     */
    @CollectionField(value = "hidden")
    private Boolean hidden;

    /**
     * 授权(多个用逗号分隔，如：sys:user:add,sys:user:edit)
     */
    @CollectionField(value = "perms")
    private String perms;

    /**
     *
     */
    @CollectionField(value = "target")
    private String target;

    /**
     * 图标
     */
    @CollectionField(value = "icon")
    private String icon;

    /**
     * 访问地址URL
     */
    @CollectionField(value = "redirect")
    private String redirect;

    /**
     * 排序
     */
    @CollectionField(value = "rank")
    private Integer rank;

    /**
     * 菜单权限类型(1:目录;2:菜单;3:按钮)
     */
    @CollectionField(value = "type")
    private Integer type;

    /**
     * 状态1:正常 0：禁用
     */
    @CollectionField(value = "status")
    private Integer status;

    /**
     * 更新时间
     */
    @CollectionField(value = "update_time")
    private Date updateTime;

    /**
     * 创建时间
     */
    @CollectionField(value = "create_time")
    private Date createTime;

    /**
     * 乐观锁
     */
    @CollectionField(value = "version_no")
    private Integer versionNo;

    @CollectionField(exist = false)
    private static final long serialVersionUID = 1L;
}
